from django.db import models
from utils.base_model import BaseModel


class NavModel(BaseModel):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=30, verbose_name="该名称", help_text="导航栏名称", unique=True)
    icon = models.CharField(max_length=50, verbose_name="导航栏图标", help_text="导航栏图标")
    path = models.CharField(max_length=50, verbose_name="该路径", help_text="导航栏路径", unique=True)
    pid = models.IntegerField(verbose_name="上级导航栏", help_text="上级导航栏", blank=True, null=True, default=0)

    class Meta:
        db_table = "dtp_nav"
        verbose_name = "导航栏"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name

